﻿// <copyright file="DefaultBrowser.cs" company="None">(c) Guy Smith-Ferrier, 2012</copyright>

namespace Browser
{
    using Microsoft.Win32;

    /// <summary>
    /// DefaultBrowser is a class that encapsulates functionality for a machine's default browser
    /// </summary>
    public class DefaultBrowser
    {
        /// <summary>
        /// Gets the command used to invoke the default browser
        /// </summary>
        public static string Command
        {
            get
            {
                RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command", false);
                if (registryKey == null)
                {
                    return null;
                }

                return registryKey.GetValue(null).ToString();
            }
        }
    }
}
